/*
Implement the plusplus operator when we are getting the input as integer array = { 9,9,9,9 }.output will be {1,0,0,0,0}
*/
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <set>

using namespace std;

vector<int> plusPlus(vector<int> &num)
{
    vector<int> ans;
    reverse(num.begin(), num.end());
    int carry = 1;
    for (int i = 0; i < num.size(); i++) {
        int sum = num[i] + carry;
        ans.push_back(sum%10);
        carry = sum/10;
    }
    if (carry != 0) ans.push_back(carry);
    reverse(ans.begin(), ans.end());
    return ans;
}

int main(int argc, char **argv)
{
    vector<int> num;
    num.push_back(9);
    num.push_back(9);
    num.push_back(9);
    num.push_back(9);
    num.push_back(8);
    vector<int> ans = plusPlus(num);
    for (int i = 0; i < ans.size(); i++) 
        cout << ans[i];
}






